﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MyVoteMVC.BackstageManagement.Views;
using MyVoteMVC.Service;
using MyVoteMVC.Common;

namespace MyVoteMVC.BackstageManagement
{
    public partial class Main : Form
    {
      
        public Main()
        {
            InitializeComponent();
        }

        private void excel导入项目数据ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ProjectsImportor form = new ProjectsImportor();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 用户管理ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            UsersManagement form = new UsersManagement();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 投票活动管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ActivityManagement form = new ActivityManagement();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 离线投票设置ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            OffLineCounter form = new OffLineCounter();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 项目管理ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ProjectManagement form = new ProjectManagement();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 字典表管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DictionaryManagement form = new DictionaryManagement();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("嗯，这是一个后台管理");
        }

        private void 消息管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {

            MessageManagement form = new MessageManagement();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 每周抽奖ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Weeklylottery form = new Weeklylottery();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }
     
        private void 活动最终抽奖ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ActivityLottery form = new ActivityLottery();
            form.MdiParent = this;
            form.WindowState = FormWindowState.Maximized;
            form.Show();
        }

        private void 重新计算在线票ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (ITickService pService = Factory.GetInstance<ITickService>())
            {
                pService.ReComputeTicket();
            }

            MessageBox.Show("重计算完成");
        }

        
    }
}
